//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Vml
{
    public class StrokeChild : IOfficeXmlSerializableAs
    {
        void IOfficeXmlSerializableAs.ReadXmlAs(string name, ReadContext context)
        {
            using (var c = context.Read(name))
            {
                Id = c.GetOptionalString("Id");
                On = c.GetOptionalBoolean("on", true); //\\default?
                Weight = c.GetOptionalString("weight");
                Color = c.GetOptionalString("color");
                opacity = c.GetOptionalString("opacity");
                LineStyle = c.GetOptionalEnum<StrokeLineStyle>("linestyle");
                MiterLimit = c.GetOptionalDouble("miterlimit");
                JoinStyle = c.GetOptionalEnum<StrokeJoinStyle>("joinstyle");
                EndCap = c.GetOptionalEnum<StrokeEndCap>("endcap");
                DashStyle = c.GetOptionalString("dashstyle");
                FillType = c.GetOptionalEnum<FillType>("filltype");
                Source = c.GetOptionalString("src");
                ImageAspect = c.GetOptionalEnum<ImageAspect>("imageaspect");
                ImageSize = c.GetOptionalString("imagesize");
                ImageAlignShape = c.GetOptionalString("imagealignshape");
                Color2 = c.GetOptionalString("color2");
                StartArrow = c.GetOptionalEnum<StrokeArrowType>("startarrow");
                StartArrowWidth = c.GetOptionalEnum<StrokeArrowWidth>("startarrowwidth");
                StartArrowLength = c.GetOptionalEnum<StrokeArrowLength>("startarrowlength");
                EndArrow = c.GetOptionalEnum<StrokeArrowType>("endarrow");
                EndArrowWidth = c.GetOptionalEnum<StrokeArrowWidth>("endarrowwidth");
                EndArrowLength = c.GetOptionalEnum<StrokeArrowLength>("endarrowlength");
                HRef = c.GetOptionalString("href");
                AltHRef = c.GetOptionalString("althref");
                Title = c.GetOptionalString("title");
                ForceDash = c.GetOptionalBoolean("forcedash", false); //\\default?
            }
        }

        void IOfficeXmlSerializableAs.WriteXmlAs(string name, WriteContext context)
        {
            using (WriteContext c = context.Write(name))
            {
                c.SetOptionalString("Id", Id);
                c.SetOptionalBoolean("on", On, true); //\\default?
                c.SetOptionalString("weight", Weight);
                c.SetOptionalString("color", Color);
                c.SetOptionalString("opacity", opacity);
                c.SetOptionalEnum("linestyle", LineStyle);
                c.SetOptionalDouble("miterlimit", MiterLimit);
                c.SetOptionalEnum("joinstyle", JoinStyle);
                c.SetOptionalEnum("endcap", EndCap);
                c.SetOptionalString("dashstyle", DashStyle);
                c.SetOptionalEnum("filltype", FillType);
                c.SetOptionalString("src", Source);
                c.SetOptionalEnum("imageaspect", ImageAspect);
                c.SetOptionalString("imagesize", ImageSize);
                c.SetOptionalString("imagealignshape", ImageAlignShape);
                c.SetOptionalString("color2", Color2);
                c.SetOptionalEnum("startarrow", StartArrow);
                c.SetOptionalEnum("startarrowwidth", StartArrowWidth);
                c.SetOptionalEnum("startarrowlength", StartArrowLength);
                c.SetOptionalEnum("endarrow", EndArrow);
                c.SetOptionalEnum("endarrowwidth", EndArrowWidth);
                c.SetOptionalEnum("endarrowlength", EndArrowLength);
                c.SetOptionalString("href", HRef);
                c.SetOptionalString("althref", AltHRef);
                c.SetOptionalString("title", Title);
                c.SetOptionalBoolean("forcedash", ForceDash, false); //\\default?
            }
        }

        private string _id;

        public string Id
        {
            get { return _id; }
            set { _id = value; }
        }
	
        private bool _on;

        public bool On
        {
            get { return _on; }
            set { _on = value; }
        }
        private string _weight;

        public string Weight
        {
            get { return _weight; }
            set { _weight = value; }
        }
        private string _color;

        public string Color
        {
            get { return _color; }
            set { _color = value; }
        }
        private string _opacity;

        public string opacity
        {
            get { return _opacity; }
            set { _opacity = value; }
        }
        private StrokeLineStyle? _linestyle;

        public StrokeLineStyle? LineStyle
        {
            get { return _linestyle; }
            set { _linestyle = value; }
        }
        private double? _miterlimit;

        public double? MiterLimit
        {
            get { return _miterlimit; }
            set { _miterlimit = value; }
        }
        private StrokeJoinStyle? _joinstyle;

        public StrokeJoinStyle? JoinStyle
        {
            get { return _joinstyle; }
            set { _joinstyle = value; }
        }
        private StrokeEndCap? _endCap;

        public StrokeEndCap? EndCap
        {
            get { return _endCap; }
            set { _endCap = value; }
        }
        private string _dashStyle;

        public string DashStyle
        {
            get { return _dashStyle; }
            set { _dashStyle = value; }
        }
        private FillType? _fillType;

        public FillType? FillType
        {
            get { return _fillType; }
            set { _fillType = value; }
        }
        private string _src;

        public string Source
        {
            get { return _src; }
            set { _src = value; }
        }
        private ImageAspect? _imageaspect;

        public ImageAspect? ImageAspect
        {
            get { return _imageaspect; }
            set { _imageaspect = value; }
        }
        private string _imageSize;

        public string ImageSize
        {
            get { return _imageSize; }
            set { _imageSize = value; }
        }
        private string _imageAlignShape;

        public string ImageAlignShape
        {
            get { return _imageAlignShape; }
            set { _imageAlignShape = value; }
        }
        private string _color2;

        public string Color2
        {
            get { return _color2; }
            set { _color2 = value; }
        }
        private StrokeArrowType? _startArrow;

        public StrokeArrowType? StartArrow
        {
            get { return _startArrow; }
            set { _startArrow = value; }
        }
        private StrokeArrowWidth? _startArrowWidth;

        public StrokeArrowWidth? StartArrowWidth
        {
            get { return _startArrowWidth; }
            set { _startArrowWidth = value; }
        }
        private StrokeArrowLength? _startArrowLength;

        public StrokeArrowLength? StartArrowLength
        {
            get { return _startArrowLength; }
            set { _startArrowLength = value; }
        }
        private StrokeArrowType? _endArrow;

        public StrokeArrowType? EndArrow
        {
            get { return _endArrow; }
            set { _endArrow = value; }
        }
        private StrokeArrowWidth? _endArrowWidth;

        public StrokeArrowWidth? EndArrowWidth
        {
            get { return _endArrowWidth; }
            set { _endArrowWidth = value; }
        }
        private StrokeArrowLength? _endArrowLength;

        public StrokeArrowLength? EndArrowLength
        {
            get { return _endArrowLength; }
            set { _endArrowLength = value; }
        }
        private string _href;

        public string HRef
        {
            get { return _href; }
            set { _href = value; }
        }
        private string _althref;

        public string AltHRef
        {
            get { return _althref; }
            set { _althref = value; }
        }
        private string _title;

        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }
        private bool forcedash;

        public bool ForceDash
        {
            get { return forcedash; }
            set { forcedash = value; }
        }



















    }
}
